import React, { useRef } from "react";

function userFD() {
  const timer = useRef(null);
  function fd(cd) {
    return (...arg) => {
      clearInterval(timer.current);
      timer.current = setTimeout(() => {
        cd(...arg);
      }, 800);
    };
  }

  return fd;
}

export default userFD;
